<template>
  <button><router-link to="/home" active-class="ooo">home</router-link></button>
  <button><router-link to="/about" exact-active-class="ooo">About</router-link></button>
  <button><router-link to="/mime" active-class="ooo">Mime</router-link></button>
  <br />
  <button @click="btnClick">编程式导航-不是路由渲染的</button>
  <hr />
  <router-view></router-view>
</template>

<script>
import { useRouter } from 'vue-router'
import router from './router/index'
export default {
  setup() {
    const btnClick = () => {
      // const router = useRouter()
      // 不是路由渲染的打印为undefinded
      // console.log(router)
      router.push('/about/address')
      console.log(router)
    }
    return {
      btnClick,
    }
  },
}
</script>

<style scoped>
.ooo {
  background-color: pink;
}
</style>
